package api.list.practice;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

public class IntegerDemo {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i <6 ; i++) {
            list.add((int)(Math.random()*10));
        }


        System.out.println(list );
        System.out.println("排序后");
        Collections.sort(list);
        System.out.println(list);


        System.out.println("降序排列后");
        Collections.reverse(list);
        System.out.println(list);
    }
}
